package com.compare;

import com.google.common.collect.Lists;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author: sun.hongliang
 * @create: 2018/10/20 10:24
 */
public class CompareTest {
    public static void main(String[] args) {
        List<Integer> list = Lists.newArrayList();
        list.add(1);
        list.add(4);
        list.add(2);
        Collections.sort(list, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2.compareTo(o1);
            }
        });
        System.out.println(list);
        System.out.println(Integer.valueOf(1).compareTo(Integer.valueOf(1)));
    }
}
